@import '../../containers/Application/colors.scss';

$blockBackgroundColor: $white;
$blockBorderColor: $silver;
$blockHandleColor: $black;
$blockHandleBackgroundColor: $silver;
$blockCollapsedColor: $gray;
$blockIconsColor: $gray;
$blockSelectedColor: $blueZodiac;

.block {
    display: flex;
    background-color: $blockBackgroundColor;
    border: 1px solid $blockBorderColor;
    border-radius: 3px;

    &:not(.expanded) {
        cursor: pointer;

        .children {
            color: $blockCollapsedColor;
            margin: 10px;
        }

        .header {
            float: right;
            display: flex;
            align-items: center;
            padding: 0;
            margin: 1em;
            height: 18px;
        }

        .icons {
            border-right: 1px solid $blockBorderColor;
            margin-right: 10px;
        }
    }

    &.expanded {
        .icons {
            line-height: 30px;
        }
    }

    &.selected {
        border-color: $blockSelectedColor;

        .handle {
            background: $blockSelectedColor;
        }
    }
}

.handle {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-grow: 0;
    flex-shrink: 0;
    color: $blockHandleColor;
    background-color: $blockHandleBackgroundColor;
    overflow: hidden;
    width: fit-content;
}

.content {
    flex-grow: 1;
    font-size: 12px;
    line-height: 18px;
    width: 0; /* avoid overflowing text editor - display flex on parent pushes it still to 100% */
}

.children {
    font-size: 12px;
    line-height: 18px;
    margin: 30px;
}

.header {
    padding: 30px 30px 0 30px;
    display: flex;
}

.types {
    min-width: 120px;
    margin-right: 10px;
}

.type {
    color: $blockCollapsedColor;
    margin-right: 10px;
    text-align: right;
    font-size: 12px;
}

.icons {
    color: $blockIconsColor;
    font-size: 14px;

    > * {
        margin-right: 10px;
    }
}

.icon-buttons {
    flex-grow: 1;
    text-align: right;

    & > button {
        cursor: pointer;
        border: none;
        background: none;
        margin-left: 20px;
    }
}
